<?php
class Genlang extends CI_Controller {

		 function __construct()
		{
		
				parent::__construct();
				$this->load->helper('cookie');

				 
		}

		function gen_lang($lang)
		{
		
			$temp = explode('_', $lang);
			
			$surl = str_replace('-', '/', $temp[0]);
			$lang = $temp[1];

			$cookie = array(
						'name'   => 'lang',
						'value'  => $lang,
						'expire' => 86500,
						'path'   => '/',
					);

			$this->input->set_cookie($cookie);
			header('location:http://'.$surl);

		}

}

?>